package com.personal.o2o.util;

import java.io.File;

public class PathUtil {
    // 获取文件的分隔符
    private static String seperator = File.separator;

    /**
     * 获取系统的图片存储路径
     * @return
     */
    public static String getImgBasePath(){
        // 获取操作系统的名称
        String os = System.getProperty("os.name");
        String basePath = "";
        if (os.toLowerCase().startsWith("win")) {
            basePath = "C:\\Download\\picture\\";
        }else{
            basePath = "/Users/chenhao/Downloads/picture/";
        }
        basePath = basePath.replace("/", seperator);
        return basePath;
    }

    /**
     * 获取店铺图片路径
     * @param shopId
     * @return
     */
    public static String getShopImagePath(long shopId){
        String imagePath = "/upload/item/shop/"+shopId+"/";
        return imagePath.replace("/", seperator);
    }
}
